# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BinaryAuthorization.V1.Model.UserOwnedGrafeasNote do
  @moduledoc """
  An user owned Grafeas note references a Grafeas Attestation.Authority Note created by the user.

  ## Attributes

  *   `delegationServiceAccountEmail` (*type:* `String.t`, *default:* `nil`) - Output only. This field will contain the service account email address that this attestor will use as the principal when querying Container Analysis. Attestor administrators must grant this service account the IAM role needed to read attestations from the note_reference in Container Analysis (`containeranalysis.notes.occurrences.viewer`). This email address is fixed for the lifetime of the attestor, but callers should not make any other assumptions about the service account email; future versions may use an email based on a different naming pattern.
  *   `noteReference` (*type:* `String.t`, *default:* `nil`) - Required. The Grafeas resource name of a Attestation.Authority Note, created by the user, in the format: `projects/[PROJECT_ID]/notes/*`. This field may not be updated. A project ID must be used, not a project number. An attestation by this attestor is stored as a Grafeas Attestation.Authority Occurrence that names a container image and that links to this Note. Grafeas is an external dependency.
  *   `publicKeys` (*type:* `list(GoogleApi.BinaryAuthorization.V1.Model.AttestorPublicKey.t)`, *default:* `nil`) - Optional. Public keys that verify attestations signed by this attestor. This field may be updated. If this field is non-empty, one of the specified public keys must verify that an attestation was signed by this attestor for the image specified in the admission request. If this field is empty, this attestor always returns that no valid attestations exist.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :delegationServiceAccountEmail => String.t() | nil,
          :noteReference => String.t() | nil,
          :publicKeys => list(GoogleApi.BinaryAuthorization.V1.Model.AttestorPublicKey.t()) | nil
        }

  field(:delegationServiceAccountEmail)
  field(:noteReference)
  field(:publicKeys, as: GoogleApi.BinaryAuthorization.V1.Model.AttestorPublicKey, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.BinaryAuthorization.V1.Model.UserOwnedGrafeasNote do
  def decode(value, options) do
    GoogleApi.BinaryAuthorization.V1.Model.UserOwnedGrafeasNote.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BinaryAuthorization.V1.Model.UserOwnedGrafeasNote do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
